#version 330 core

in vec2 TexCoords;
out vec4 FragColor;

uniform sampler2D image;
uniform vec4 color;
uniform int exist;

void main()
{
    vec4 texColor = texture(image, TexCoords);

    if (exist == 1) {
        if (texColor.a > 0.1)
            FragColor = vec4(color);
         else {
            discard;
        }
    } else {
        FragColor = texColor;
    }
}